import { Reducer } from '@reduxjs/toolkit';
import { createContext } from 'react';

type MyContextType = {
  updateRedux: <T extends { name: string; reducer: Reducer<T> }>({
    reducer,
    name,
  }: T) => void;
  removeSlice: <T extends { name: string; getInitialState: () => unknown }>({
    name,
  }: T) => void;
};

export const myContext = createContext<MyContextType>({
  updateRedux: () => {},
  removeSlice: () => {},
});
